package main

import (
	"log"
	"net/http"
	"rlhs/config"
	_ "rlhs/web"
)

//http://localhost/liveness/recognition
//http://localhost/get/action/sequence
//http://localhost/get/live/code

//http://localhost/image/recognition

func main() {
	//监听端口
	addr := config.Confs.GetString("HttpConf.IP") + ":" + config.Confs.GetString("HttpConf.Port")
	err := http.ListenAndServe(addr, nil)
	if err != nil {
		log.Println(err.Error())
	}
}

/*
func main() {
	// 实例化一个认证对象，入参需要传入腾讯云账户secretId，secretKey,此处还需注意密钥对的保密
	// 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取
	credential := common.NewCredential(
		"AKIDkMyb3II5fHwQfeU5QWM0RedPxJVVGm35",
		"tWu4zf6Jcq593lUEoETgkaCcrtkibIm3",
	)
	// 实例化一个client选项，可选的，没有特殊需求可以跳过
	cpf := profile.NewClientProfile()
	cpf.HttpProfile.Endpoint = "faceid.tencentcloudapi.com"
	// 实例化要请求产品的client对象,clientProfile是可选的
	client, _ := faceid.NewClient(credential, "", cpf)

	// 实例化一个请求对象,每个接口都会对应一个request对象
	request := faceid.NewLivenessRecognitionRequest()

	request.IdCard = common.StringPtr("130925199012077212")
	request.Name = common.StringPtr("赵金鼎")
	request.VideoBase64 = common.StringPtr("")
	request.VideoUrl = common.StringPtr("https://zjd-1313527659.cos.ap-beijing.myqcloud.com/ea5e269c59c1c15cb8b16f350debbaf7.mp4")
	request.ValidateData = common.StringPtr("")
	request.Optional = common.StringPtr("")
	request.LivenessType = common.StringPtr("SILENT")

	// 返回的resp是一个LivenessRecognitionResponse的实例，与请求对象对应
	response, err := client.LivenessRecognition(request)
	if _, ok := err.(*errors.TencentCloudSDKError); ok {
		fmt.Printf("An API error has returned: %s", err)
		return
	}
	if err != nil {
		panic(err)
	}
	// 输出json格式的字符串回包
	fmt.Printf("%s", response.ToJsonString())
}*/
